Modern systems are complex systems that include multiple processing engines, such as multiprocessor systems, multicore processors, and the like. Furthermore, multiple threads or agents can be processed simultaneously in one or more processors of the system. Accordingly, the operation and synchronization of different portions of a system are becoming more involved.
One problem that may arise as a result of the increased complexity of computing systems is a lock situation. Such a situation can occur when multiple agents desire to use the same resource. Such agents may be different software threads, different system components or the like, and similarly, the resources competed for may be hardware resources of a processor, a memory execution unit of the processor or other system components, or data owned by a system agent.
When multiple agents of a system compete for ownership of a resource, performance can be negatively affected. In one scenario, at least one agent cannot make forward progress until it is able to obtain ownership of the resource. In an even more serious scenario, neither of an owning system agent and a requesting system agent can make forward progress as the requesting agent consumes the owning agent with requests for ownership or similar requests. Other examples of a lock situation are when two agents wait for each other to release an occupied resource.
A lock situation may be of different types, including a so-called “live” lock situation or a so-called “dead” lock situation. In a live lock situation, one or more agents is highly active in attempting to gain ownership of the desired resource. In such a situation, the owner agent may find it very difficult to make forward progress with its task as repeated requests for ownership are received from the requesting block, or each time the resource becomes free, a first requesting agent is denied and a second requesting agent obtains the resource. In a dead lock situation, one or more agents may simply be in a wait state, waiting for a desired resource. However, during this wait state, the agent does not perform any useful work.
During both design and validation stages, efforts are made to avoid such lock situations. However, in light of the complexity of modern systems, lock situations may continue to occur. Furthermore, efforts to resolve a lock situation can have undesired negative performance effects on a system.